package com.example.cloud;

import com.example.cloud.filter.RequestFilter;
import com.example.cloud.filter.RouteErrorFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableZuulProxy
@EnableEurekaClient
@EnableFeignClients
@ComponentScan("com.example")
public class GatewayZuulApplication {

	@Bean
	public RequestFilter getAuthFilter(){
		return new RequestFilter();
	}

	@Bean
	public RouteErrorFilter getRouteErrorFilter(){
		return new RouteErrorFilter();
	}

	public static void main(String[] args) {
		SpringApplication.run(GatewayZuulApplication.class, args);
	}
}
